From 78ab1ea3fcb1311863967dba02c0707db3842562 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Mon, 1 Feb 1999 21:55:49 +0000 Subject: [PATCH] Fixed problem with uints resulting in huge child allocations. Mon Feb 1 15:14:56 1999 Owen Taylor * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): Fixed problem with uints resulting in huge child allocations. --- ChangeLog | 16 +++++++++++----- ChangeLog.pre-2-0 | 16 +++++++++++----- ChangeLog.pre-2-10 | 16 +++++++++++----- ChangeLog.pre-2-2 | 16 +++++++++++----- ChangeLog.pre-2-4 | 16 +++++++++++----- ChangeLog.pre-2-6 | 16 +++++++++++----- ChangeLog.pre-2-8 | 16 +++++++++++----- gtk/gtkoptionmenu.c | 10 +++++----- 8 files changed, 82 insertions(+), 40 deletions(-) diff --git a/ChangeLog b/ChangeLog index 27fad15951..4a070c104e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,11 +1,17 @@ +Mon Feb 1 15:14:56 1999 Owen Taylor + + * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): + Fixed problem with uints resulting in huge child + allocations. + Mon Feb 1 14:54:28 1999 Owen Taylor * gtk/gtklabel.c (gtk_label_expose): Cast uints - to ints in geometry calculations. This should - prevent FP exceptions on FreeBSD when quantities - become negative. [ Actually, this is probably - a workaround with a gcc bug with handling of - bitfields, according to Ben Jackson ] + to ints in geometry calculations. This should + prevent FP exceptions on FreeBSD when quantities + become negative. [ Actually, this is probably + a workaround with a gcc bug with handling of + bitfields, according to Ben Jackson ] Mon Feb 1 13:35:14 GMT 1999 Tony Gale diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 27fad15951..4a070c104e 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,11 +1,17 @@ +Mon Feb 1 15:14:56 1999 Owen Taylor + + * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): + Fixed problem with uints resulting in huge child + allocations. + Mon Feb 1 14:54:28 1999 Owen Taylor * gtk/gtklabel.c (gtk_label_expose): Cast uints - to ints in geometry calculations. This should - prevent FP exceptions on FreeBSD when quantities - become negative. [ Actually, this is probably - a workaround with a gcc bug with handling of - bitfields, according to Ben Jackson ] + to ints in geometry calculations. This should + prevent FP exceptions on FreeBSD when quantities + become negative. [ Actually, this is probably + a workaround with a gcc bug with handling of + bitfields, according to Ben Jackson ] Mon Feb 1 13:35:14 GMT 1999 Tony Gale diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 27fad15951..4a070c104e 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,11 +1,17 @@ +Mon Feb 1 15:14:56 1999 Owen Taylor + + * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): + Fixed problem with uints resulting in huge child + allocations. + Mon Feb 1 14:54:28 1999 Owen Taylor * gtk/gtklabel.c (gtk_label_expose): Cast uints - to ints in geometry calculations. This should - prevent FP exceptions on FreeBSD when quantities - become negative. [ Actually, this is probably - a workaround with a gcc bug with handling of - bitfields, according to Ben Jackson ] + to ints in geometry calculations. This should + prevent FP exceptions on FreeBSD when quantities + become negative. [ Actually, this is probably + a workaround with a gcc bug with handling of + bitfields, according to Ben Jackson ] Mon Feb 1 13:35:14 GMT 1999 Tony Gale diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 27fad15951..4a070c104e 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,11 +1,17 @@ +Mon Feb 1 15:14:56 1999 Owen Taylor + + * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): + Fixed problem with uints resulting in huge child + allocations. + Mon Feb 1 14:54:28 1999 Owen Taylor * gtk/gtklabel.c (gtk_label_expose): Cast uints - to ints in geometry calculations. This should - prevent FP exceptions on FreeBSD when quantities - become negative. [ Actually, this is probably - a workaround with a gcc bug with handling of - bitfields, according to Ben Jackson ] + to ints in geometry calculations. This should + prevent FP exceptions on FreeBSD when quantities + become negative. [ Actually, this is probably + a workaround with a gcc bug with handling of + bitfields, according to Ben Jackson ] Mon Feb 1 13:35:14 GMT 1999 Tony Gale diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 27fad15951..4a070c104e 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,11 +1,17 @@ +Mon Feb 1 15:14:56 1999 Owen Taylor + + * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): + Fixed problem with uints resulting in huge child + allocations. + Mon Feb 1 14:54:28 1999 Owen Taylor * gtk/gtklabel.c (gtk_label_expose): Cast uints - to ints in geometry calculations. This should - prevent FP exceptions on FreeBSD when quantities - become negative. [ Actually, this is probably - a workaround with a gcc bug with handling of - bitfields, according to Ben Jackson ] + to ints in geometry calculations. This should + prevent FP exceptions on FreeBSD when quantities + become negative. [ Actually, this is probably + a workaround with a gcc bug with handling of + bitfields, according to Ben Jackson ] Mon Feb 1 13:35:14 GMT 1999 Tony Gale diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 27fad15951..4a070c104e 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,11 +1,17 @@ +Mon Feb 1 15:14:56 1999 Owen Taylor + + * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): + Fixed problem with uints resulting in huge child + allocations. + Mon Feb 1 14:54:28 1999 Owen Taylor * gtk/gtklabel.c (gtk_label_expose): Cast uints - to ints in geometry calculations. This should - prevent FP exceptions on FreeBSD when quantities - become negative. [ Actually, this is probably - a workaround with a gcc bug with handling of - bitfields, according to Ben Jackson ] + to ints in geometry calculations. This should + prevent FP exceptions on FreeBSD when quantities + become negative. [ Actually, this is probably + a workaround with a gcc bug with handling of + bitfields, according to Ben Jackson ] Mon Feb 1 13:35:14 GMT 1999 Tony Gale diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 27fad15951..4a070c104e 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,11 +1,17 @@ +Mon Feb 1 15:14:56 1999 Owen Taylor + + * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): + Fixed problem with uints resulting in huge child + allocations. + Mon Feb 1 14:54:28 1999 Owen Taylor * gtk/gtklabel.c (gtk_label_expose): Cast uints - to ints in geometry calculations. This should - prevent FP exceptions on FreeBSD when quantities - become negative. [ Actually, this is probably - a workaround with a gcc bug with handling of - bitfields, according to Ben Jackson ] + to ints in geometry calculations. This should + prevent FP exceptions on FreeBSD when quantities + become negative. [ Actually, this is probably + a workaround with a gcc bug with handling of + bitfields, according to Ben Jackson ] Mon Feb 1 13:35:14 GMT 1999 Tony Gale diff --git a/gtk/gtkoptionmenu.c b/gtk/gtkoptionmenu.c index bf42d863e8..c888625fca 100644 --- a/gtk/gtkoptionmenu.c +++ b/gtk/gtkoptionmenu.c @@ -307,11 +307,11 @@ gtk_option_menu_size_allocate (GtkWidget *widget, GTK_WIDGET (widget)->style->klass->xthickness) + 1; child_allocation.y = (GTK_CONTAINER (widget)->border_width + GTK_WIDGET (widget)->style->klass->ythickness) + 1; - child_allocation.width = (allocation->width - child_allocation.x * 2 - - OPTION_INDICATOR_WIDTH - OPTION_INDICATOR_SPACING * 5 - - CHILD_LEFT_SPACING - CHILD_RIGHT_SPACING) - 2; - child_allocation.height = (allocation->height - child_allocation.y * 2 - - CHILD_TOP_SPACING - CHILD_BOTTOM_SPACING) - 2; + child_allocation.width = MAX (1, (gint)allocation->width - child_allocation.x * 2 - + OPTION_INDICATOR_WIDTH - OPTION_INDICATOR_SPACING * 5 - + CHILD_LEFT_SPACING - CHILD_RIGHT_SPACING - 2); + child_allocation.height = MAX (1, (gint)allocation->height - child_allocation.y * 2 - + CHILD_TOP_SPACING - CHILD_BOTTOM_SPACING - 2); child_allocation.x += CHILD_LEFT_SPACING; child_allocation.y += CHILD_RIGHT_SPACING; -- 2.30.2